package com.acheli.rideable.functionLathes.component.propeller;


import com.acheli.rideable.entites.RideableEntity;
import com.acheli.rideable.functionLathes.ComponentFL;
import com.acheli.utils.math.angle.AbstractAngle;
import com.acheli.utils.math.angle.Angle;
import net.minecraft.world.phys.Vec3;

public class PropellerBase  extends ComponentFL implements AbstractPropeller{
    AbstractAngle attackAngle = new Angle(0);
    private double bladeSquareMeter = 0F;
    private double bladeLength = 0F;

    public PropellerBase (String ID, RideableEntity vehicle, Vec3 relativePosition, Angle attackAngle){
        super(ID, vehicle, relativePosition);
        this.attackAngle = attackAngle;
    }


    public Vec3 getForce() {
        double realLift = 0;
            //攻角升力
            double attackAngle = getAttackAngle().getAngleNum();
            double dragLiftProportion = Math.tan(attackAngle);
            double width = getRevolutionSpeed();
            double height = width * dragLiftProportion;
            realLift += (height*width/2);

        return new Vec3(0, realLift, 0);//获得合力
    }

    @Override
    public void setBlade(PropellerBlade blade) {

    }

    @Override
    public PropellerBlade getBlade() {
        return null;
    }

    @Override
    public void setAttackAngle(AbstractAngle attackAngle) {
        this.attackAngle = attackAngle;
    }

    @Override
    public AbstractAngle getAttackAngle() {
        return this.attackAngle;
    }
}
